package com.netdisk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.netdisk.entity.UserActivity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户活动日志Mapper接口
 */
@Mapper
public interface UserActivityMapper extends BaseMapper<UserActivity> {

    /**
     * 获取用户最近活动日志
     *
     * @param userId 用户ID
     * @param limit 最大记录数
     * @return 活动日志列表
     */
    @Select("SELECT * FROM user_activities WHERE user_id = #{userId} ORDER BY created_at DESC LIMIT #{limit}")
    List<UserActivity> selectRecentActivities(@Param("userId") Integer userId, @Param("limit") Integer limit);
} 